const path = require('path');

module.exports = {
    devServer: {
        port: 1423,
        proxy: {
            '/my': {
                target: "http://m.maoyan.com/ajax/",
                changOrigin: true,
                pathRewrite: {
                    '^/my': ''
                }
            }
        }
    },
    // 创建 import 或 require 的别名，来确保模块引入变得更简单(配置别名)
    chainWebpack: config => {
        config
        .resolve
        .alias
        .set('@styles', path.resolve(__dirname, 'src/stylesheets'))
        .set('@libs', path.resolve(__dirname, 'src/libs'))
        .set('@com', path.resolve(__dirname, 'src/components'))
        .set('@pages', path.resolve(__dirname, 'src/pages'))
        .set('@assets', path.resolve(__dirname, 'src/assets'))
        .set('@util', path.resolve(__dirname, 'src/util'))
        .set('@router', path.resolve(__dirname, 'src/router'))

    }
}
